home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 71 < prev    next >
Text File  |  1996-08-06  |  2KB  |  44 lines

  1. Newsgroups: comp.std.c
  2. Path: blackbush.xlink.net!slsv6bt!slsv6bt!kanze
  3. From: kanze@lts.sel.alcatel.de (James Kanze US/ESC 60/3/141 #40763)
  4. Subject: Re: Undefined result vs. int's holding undefined values.
  5. In-Reply-To: larry.jones@sdrc.com's message of 9 Jan 1996 19:58:54 GMT
  6. Message-ID: <KANZE.96Jan10105153@slsvewt.lts.sel.alcatel.de>
  7. Sender: news@lts.sel.alcatel.de
  8. Organization: SEL
  9. References: <4ck70b$rd7@news.informix.com> <4ckms5$rd7@news.informix.com>
  10.     <4cpv1n$apm@der.twinsun.com> <4cuhdu$ff2@info1.sdrc.com>
  11. Date: 10 Jan 1996 09:51:52 GMT
  12.  
  13. In article <4cuhdu$ff2@info1.sdrc.com> larry.jones@sdrc.com (Larry
  14. Jones) writes:
  15.  
  16. |> In article <4cpv1n$apm@der.twinsun.com>, eggert@twinsun.com (Paul Eggert) writes:
  17. |> > Since this is comp.std.c, I'll mention that the (x + y < x) != (y < 0) method
  18. |> > and Daniel Wood's example both port to any C implementation
  19. |> > claiming conformance to LIA-1 (ISO/IEC 10967-1:1994(E),
  20. |> > `Information technology -- Language independent arithmetic -- Part 1:
  21. |> > Integer floating point arithmetic' <ftp://crl.dec.com/pub/misc/lia-1-dis.ps.Z>)
  22. |> > if INT_MODULO is true (which is the only plausible value for INT_MODULO
  23. |> > for real-world C compilers).
  24.  
  25. |> The current thinking about binding LIA-1 to C allows signed and unsiged
  26. |> integers to have different behavior.  Whilst unsigned integers *have*
  27. |> to be MODULO for standard conformance, there is no good reason for
  28. |> signed integers to be the same (other than that many existing machine
  29. |> architectures make it very inconvenient to have them be different). 
  30. |> Some (many?) people think that raising an exception of some kind for
  31. |> signed integer overflow is very desirable, rather than allowing the
  32. |> answer to quietly wrap around.
  33.  
  34. Actually, at least some people think that raising an exception would
  35. be desirable for unsigned as well:-).  The problem (in C, at least),
  36. in addition to breaking existing code, is that you do need some type
  37. for which the modulo arithmetic is well defined.
  38. --
  39. James Kanze         Tel.: (+33) 88 14 49 00        email: kanze@gabi-soft.fr
  40. GABI Software, Sarl., 8 rue des Francs-Bourgeois, F-67000 Strasbourg, France
  41. Conseils, Θtudes et rΘalisations en logiciel orientΘ objet --
  42.                 -- A la recherche d'une activitΘ dans une region francophone
  43.  
  44.